﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Net;
using System.Runtime.Serialization;
using System.Windows;
using System.Windows.Controls;

namespace DiscoveryLogic.DataServices.DataObjects.Entities
{
    [DataContract(Namespace=Settings.DataObjectNamespace)]
    public class Entity 
    {
        private Guid _EntityID;
        private string _Domain;
        private EntityType _EntityType;

        public Entity(Guid mentityId, EntityType mentityType, string mdomain)
        {
            _EntityID = mentityId;
            _Domain = mdomain;
            _EntityType = mentityType;
            this.Associations=new List<Association>();
            this.Navigations=new List<Navigation>();
        }

        #region props
        [DataMember]
        public EntityType EntityType
        {
            get
            {
                return _EntityType;
            }
            set
            {
                _EntityType = value;
            }
        }
        [DataMember]
        public string Domain
        {
            get
            {
                return _Domain;
            }
            set
            {
                _Domain = value;
            }
        }
        [DataMember]
        public Guid EntityID
        {
            get
            {
                return _EntityID;
            }
            set
            {
                _EntityID = value;
            }
        }
        #endregion

        [DataMember]
        public List<Association> Associations
        {
            get;
            set;
        }
        [DataMember]
        public List<Navigation> Navigations
        {
            get;
            set;
        }

        public event PropertyChangedEventHandler PropertyChanged;
        protected void OnPropertyChanged(string propName)
        {
            if(this.PropertyChanged !=null)
                this.PropertyChanged(this,new PropertyChangedEventArgs(propName));
        }
    }
}
